fs: Use safe math macros to prevent overflows
authorLidong Chen <lidong.chen@oracle.com>
Tue, 21 Jan 2025 19:02:36 +0000 (19:02 +0000)
committerMiao Wang <shankerwangmiao@gmail.com>
Sun, 15 Feb 2026 13:50:20 +0000 (13:50 +0000)
commit0fb51cb39e6470dc92a2d38dbea62d1e3685fc74
treeac7ddb9da5cd263683a555cf94c441856f642438
parent3354bcd21b2fce4eece92f92511b948c98bfeec4
fs: Use safe math macros to prevent overflows

Replace direct arithmetic operations with macros from include/grub/safemath.h
to prevent potential overflow issues when calculating the memory sizes.

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/fs/erofs.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-Use-safe-math-macros-to-prevent-overflows.patch
grub-core/fs/archelp.c
grub-core/fs/btrfs.c
grub-core/fs/cpio_common.c
grub-core/fs/f2fs.c
grub-core/fs/ntfscomp.c
grub-core/fs/squash4.c
grub-core/fs/xfs.c